',
dots=data.dots ? data.dots:false,
themeClass=data.themeclass ? data.themeclass:'owl-theme',
center=data.center ? data.center:false,
items=data.items ? data.items:4,
autoplay=data.autoplay ? data.autoplay:false,
responsiveXs=data.responsiveXs ? data.responsiveXs:1,
responsiveSm=data.responsiveSm ? data.responsiveSm:2,
responsiveMd=data.responsiveMd ? data.responsiveMd:3,
responsiveLg=data.responsiveLg ? data.responsiveLg:4,
draggable=(data.draggable===false) ? data.draggable:true,
syncedClass=(data.syncedClass) ? data.syncedClass:false,
filters=data.filters ? data.filters:false;
if(filters){
$carousel.after($carousel.clone().addClass('owl-carousel-filter-cloned'));
$(filters).on('click', 'a', function(e){
e.preventDefault();
if($(this).hasClass('selected')){
return;
}
var filterValue=$(this).attr('data-filter');
$(this).siblings().removeClass('selected active');
$(this).addClass('selected active');
for (var i=$carousel.find('.owl-item').length - 1; i >=0; i--){
$carousel.trigger('remove.owl.carousel', [1]);
};
var $filteredItems=$($carousel.next().find(' > ' +filterValue).clone());
$filteredItems.each(function(){
$carousel.trigger('add.owl.carousel', $(this));
$(this).addClass('scaleAppear');
});
$carousel.trigger('refresh.owl.carousel');
if($().prettyPhoto){
$carousel.find("a[data-gal^='prettyPhoto']").prettyPhoto({
hook: 'data-gal',
theme: 'facebook'
});
}});
}
$carousel.owlCarousel({
loop: loop,
margin: margin,
nav: nav,
autoplay: autoplay,
dots: dots,
themeClass: themeClass,
center: center,
navText: [navPrev,navNext],
mouseDrag: draggable,
touchDrag: draggable,
items: items,
responsive: {
0:{
items: responsiveXs
},
576:{
items: responsiveSm
},
992:{
items: responsiveMd
},
1200:{
items: responsiveLg
}},
})
.addClass(themeClass);
if(center){
$carousel.addClass('owl-center');
}
$window.on('resize', function(){
$carousel.trigger('refresh.owl.carousel');
});
if($carousel.hasClass('owl-news-slider-items')&&syncedClass){
$carousel.on('changed.owl.carousel', function(e){
var indexTo=loop ? e.item.index+1:e.item.index;
$(syncedClass).trigger('to.owl.carousel', [indexTo]);
})
}});
}
var $header=$('.page_header').first();
var boxed=$header.closest('.boxed').length;
var headerSticked=$('.header_side_sticked').length;
var headerStickedDisabled=($body.hasClass('header_disable_affix_xl')&&$body.hasClass('header_disable_affix_xs')) ? true:false;
if($header.length){
menuHideExtraElements();
initMegaMenu(1);
if(!headerStickedDisabled){
var headerHeight=$header.outerHeight();
$header.wrap('');
var $headerWrapper=$('.page_header_wrapper');
if(!boxed){
$headerWrapper.css({height: headerHeight});
}
if($header.hasClass('ls')){
$headerWrapper.addClass('ls');
if($header.hasClass('ms')){
$headerWrapper.addClass('ms');
}}else if($header.hasClass('ds')){
$headerWrapper.addClass('ds');
if($header.hasClass('bs')){
$headerWrapper.addClass('bs');
}
if($header.hasClass('ms')){
$headerWrapper.addClass('ms');
}}else if($header.hasClass('cs')){
$headerWrapper.addClass('cs');
if($header.hasClass('cs2')){
$headerWrapper.addClass('cs2');
}
if($header.hasClass('cs3')){
$headerWrapper.addClass('cs3');
}}else if($header.hasClass('gradient-background')){
$headerWrapper.addClass('gradient-background');
}
var headerOffset=0;
if(!boxed&&!($headerWrapper.css('position')==='fixed')){
headerOffset=$header.offset().top;
}
$header.on('affixed-top.bs.affix affixed.bs.affix affixed-bottom.bs.affix', function(e){
if($header.hasClass('affix-top')){
$headerWrapper.removeClass('affix-wrapper affix-bottom-wrapper').addClass('affix-top-wrapper');
}else if($header.hasClass('affix')){
$headerWrapper.removeClass('affix-top-wrapper affix-bottom-wrapper').addClass('affix-wrapper');
}else if($header.hasClass('affix-bottom')){
$headerWrapper.removeClass('affix-wrapper affix-top-wrapper').addClass('affix-bottom-wrapper');
}else{
$headerWrapper.removeClass('affix-wrapper affix-top-wrapper affix-bottom-wrapper');
}
if(boxed&&!($header.css('position')==='fixed')){
menuHideExtraElements();
initMegaMenu(1);
}
if(headerSticked){
initMegaMenu(1);
}});
$header.on('affixed-top.bs.affix', function (){
});
$header.on('affix.bs.affix', function(){
if(!$window.scrollTop()) return false;
});
$header.affix({
offset: {
top: headerOffset,
bottom: -10
}});
}} //$header.length if check
initAffixSidebar();
$body.scrollspy('refresh');
if($().appear){
var $animate=$('.animate');
$animate.appear();
$animate.filter(':appeared').each(function(index){
initAnimateElement($(this), index);
});
$body.on('appear', '.animate', function(e, $affected){
$($affected).each(function(index){
initAnimateElement($(this), index);
});
});
if($().countTo){
var $counter=$('.counter');
$counter.appear();
$counter.filter(':appeared').each(function(){
initCounter($(this));
});
$body.on('appear', '.counter', function(e, $affected){
$($affected).each(function(){
initCounter($(this));
});
});
}
if($().progressbar){
var $progressbar=$('.progress .progress-bar');
$progressbar.appear();
$progressbar.filter(':appeared').each(function(){
initProgressbar($(this));
});
$body.on('appear', '.progress .progress-bar', function(e, $affected){
$($affected).each(function(){
initProgressbar($(this));
});
});
$('a[data-toggle="tab"]').on('shown.bs.tab', function(e){
initProgressbar($($(e.target).attr('href')).find('.progress .progress-bar'));
});
$('.dropdown').on('shown.bs.dropdown', function(e){
initProgressbar($(this).find('.progress .progress-bar'));
});
}
if($().easyPieChart){
var $chart=$('.chart');
$chart.appear();
$chart.filter(':appeared').each(function(){
initChart($(this));
});
$body.on('appear', '.chart', function(e, $affected){
$($affected).each(function(){
initChart($(this));
});
});
}}
if($().jflickrfeed){
var $flickr=$("#flickr, .flickr_ul");
if($flickr.length){
if(!($flickr.hasClass('flickr_loaded'))){
$flickr.jflickrfeed({
flickrbase: "http://api.flickr.com/services/feeds/",
limit: 4,
qstrings: {
id: "131791558@N04"
},
itemTemplate: ' '
}, function(data){
initPhotoSwipe();
}).addClass('flickr_loaded');
}}
}
if($().spectragram){
var Spectra={
instaToken: '3905738328.60c782d.b65ed3f058d64e6ab32c110c6ac12d9b',
instaID: '60c782dfecaf4050b59ff4c159246641',
init: function (){
jQuery.fn.spectragram.accessData={
accessToken: this.instaToken,
clientID: this.instaID
};
$('.instafeed').each(function(){
var $this=$(this);
if($this.find('img').length){
return;
}
$this.spectragram('getRecentTagged',{
max: 8,
query: 'grey',
wrapEachWith: ' '
});
});
}}
Spectra.init();
}
$('.isotope-wrapper').each(function(index){
var $container=$(this);
var layoutMode=($container.hasClass('masonry-layout')) ? 'masonry':'fitRows';
var columnWidth=($container.children('.col-md-4').length) ? '.col-md-4':false;
$container.isotope({
percentPosition: true,
layoutMode: layoutMode,
masonry: {
columnWidth: columnWidth
}});
var $filters=$container.attr('data-filters') ? $($container.attr('data-filters')):$container.prev().find('.filters');
if($filters.length){
$filters.on('click', 'a', function(e){
e.preventDefault();
var $thisA=$(this);
var filterValue=$thisA.attr('data-filter');
$container.isotope({ filter: filterValue });
$thisA.siblings().removeClass('selected active');
$thisA.addClass('selected active');
});
$filters.on('change', 'select', function(e){
e.preventDefault();
var filterValue=$(this).val();
$container.isotope({ filter: filterValue });
});
}});
$('#toggle_shop_view').on('click', function(e){
e.preventDefault();
$(this).toggleClass('grid-view');
$('#products').toggleClass('grid-view list-view');
});
var $product=$('.product.type-product');
$product.find('.entry-summary .quantity input').before(' ');
$product.find('.entry-summary .quantity').append(' ');
var $shopTable=$('.shop_table_responsive');
$shopTable.find('.product-quantity .quantity input').before(' ');
$shopTable.find('.product-quantity .quantity').append(' ');
$('.plus, .minus').on('click', function (e){
var numberField=$(this).parent().find('[type="number"]');
var currentVal=numberField.val();
var sign=$(this).val();
if(sign==='-'){
if(currentVal > 1){
numberField.val(parseFloat(currentVal) - 1);
}}else{
numberField.val(parseFloat(currentVal) + 1);
}});
var className=$('#content_products').parent().attr('class');
$('#content_products .toggle_view .full').on('click', function (e){
e.preventDefault();
$('#content_products .toggle_view .full.active').removeClass('active');
$('#content_products .toggle_view .grid.active').removeClass('active');
$(this).closest('.' + className).removeClass(className).addClass('columns-1');
$(this).addClass('active');
});
$('#content_products .toggle_view .grid').on('click', function (e){
e.preventDefault();
$('#content_products .toggle_view .full.active').removeClass('active');
$('#content_products .toggle_view .grid.active').removeClass('active');
$(this).closest('.columns-1').removeClass('columns-1').addClass(className);
$(this).addClass('active');
});
$('#toggle_shop_view').on('click', function(e){
e.preventDefault();
$(this).toggleClass('grid-view');
$('#products').toggleClass('grid-view list-view');
});
if($('.widget_price_filter .price_slider_amount')){
$('button.button').appendTo($('.price_label').parent());
}
$('a.showlogin, a.showcoupon').on('click', function(e){
e.preventDefault();
var $form=$(this).parent().next();
if($form.css('display')==='none'){
$form.show(150);
}else{
$form.hide(150);
}});
$('a.remove').on('click', function(e){
e.preventDefault();
$(this).closest('tr, .media').remove();
});
$('.images').flexslider({
animation: "slide",
controlNav: "thumbnails",
selector: "figure > div",
directionNav: false,
});
$('.wc-tab, .woocommerce-tabs .panel:not(.panel .panel)').hide();
$('.wc-tabs li a, ul.tabs li a').on('click', function(e){
e.preventDefault();
var $tab=$(this);
var $tabs_wrapper=$tab.closest('.wc-tabs-wrapper, .woocommerce-tabs');
var $tabs=$tabs_wrapper.find('.wc-tabs, ul.tabs');
$tabs.find('li').removeClass('active');
$tabs_wrapper.find('.wc-tab, .panel:not(.panel .panel)').hide();
$tab.closest('li').addClass('active');
$tabs_wrapper.find($tab.attr('href')).show();
});
$('a.woocommerce-review-link').on('click', function(){
$('.reviews_tab a').trigger('click');
return true;
});
var hash=window.location.hash;
var url=window.location.href;
var $tabs=$('.wc-tabs, ul.tabs').first();
if(hash.toLowerCase().indexOf('comment-') >=0||hash==='#reviews'||hash==='#tab-reviews'){
$tabs.find('li.reviews_tab a').trigger('click');
}else if(url.indexOf('comment-page-') > 0||url.indexOf('cpage=') > 0){
$tabs.find('li.reviews_tab a').trigger('click');
}else if(hash==='#tab-additional_information'){
$tabs.find('li.additional_information_tab a').trigger('click');
}else{
$tabs.find('li:first a').trigger('click');
}
if($().slider){
var $rangeSlider=$(".slider-range-price");
if($rangeSlider.length){
var $priceMin=$(".slider_price_min");
var $priceMax=$(".slider_price_max");
$rangeSlider.slider({
range: true,
min: 0,
max: 100000,
values: [ 1500, 30000 ],
slide: function(event, ui){
$priceMin.val(ui.values[ 0 ]);
$priceMax.val(ui.values[ 1 ]);
}});
$priceMin.val($rangeSlider.slider("values", 0));
$priceMax.val($rangeSlider.slider("values", 1));
}}
$('.related.products ul.products, .upsells.products ul.products, .cross-sells ul.products')
.addClass('owl-carousel top-right-nav')
.owlCarousel({
loop: false,
autoplay: true,
margin: 30,
nav: true,
dots: false,
items: 3,
navText: [' ', ' '],
responsive: {
0: {
items: 2
},
479: {
items: 2
},
992: {
items: 2
},
1200: {
items: 3
}}
});
$(".color-filters").find("a[data-background-color]").each(function(){
$(this).css({"background-color":$(this).data("background-color")});
});
var $messagesModal=$('#messages_modal');
if($messagesModal.find('ul').length){
$messagesModal.modal('show');
}
$(".preloader_img, .preloader_css").fadeOut(800);
setTimeout(function (){
$(".preloader").fadeOut(800, function(){
});
}, 200);
}
$(function(){
documentReadyInit();
initGoogleMap();
});
$window.on('load', function(){
windowLoadInit();
});
$window.on('resize', function(){
$body.scrollspy('refresh');
menuHideExtraElements();
initMegaMenu(1);
var headerStickedDisabled=($body.hasClass('header_disable_affix_xl')&&$body.hasClass('header_disable_affix_xs')) ? true:false;
if(!headerStickedDisabled){
var $header=$('.page_header').first();
if($header.length&&!$(document).scrollTop()&&$header.first().data('bs.affix')){
$header.first().data('bs.affix').options.offset.top=$header.offset().top;
}
if(!$header.closest('.boxed').length){
var affixed=false;
if($header.hasClass('affix')){
affixed=true;
$header.removeClass('affix');
setTimeout(function (){
$(".page_header_wrapper").css({height: $header.first().outerHeight()});
$header.addClass('affix');
}, 250);
}
if(!affixed){
$(".page_header_wrapper").css({height: $header.first().outerHeight()});
}}
}});
})(jQuery);